home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / demo / client / scripts / playerList.cs < prev    next >
Encoding:
Text File  |  2005-11-23  |  1.2 KB  |  33 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine 
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5.  
  6. //-----------------------------------------------------------------------------
  7. // Hook into the client update messages to maintain our player list
  8. // and scoreboard.
  9. //-----------------------------------------------------------------------------
  10.  
  11. addMessageCallback('MsgClientJoin', handleClientJoin);
  12. addMessageCallback('MsgClientDrop', handleClientDrop);
  13. addMessageCallback('MsgClientScoreChanged', handleClientScoreChanged);
  14.  
  15. //-----------------------------------------------------------------------------
  16.  
  17. function handleClientJoin(%msgType, %msgString, %clientName, %clientId,
  18.    %guid, %score, %isAI, %isAdmin, %isSuperAdmin )
  19. {
  20.    PlayerListGui.update(%clientId,detag(%clientName),%isSuperAdmin,
  21.       %isAdmin,%isAI,%score);
  22. }
  23.  
  24. function handleClientDrop(%msgType, %msgString, %clientName, %clientId)
  25. {
  26.    PlayerListGui.remove(%clientId);
  27. }
  28.  
  29. function handleClientScoreChanged(%msgType, %msgString, %score, %clientId)
  30. {
  31.    PlayerListGui.updateScore(%clientId,%score);
  32. }
  33.